//
//  Mine_AddressbookTableViewCell.m
//  fxxiaoke
//
//  Created by 鞠超 on 2016/11/11.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "Mine_AddressbookTableViewCell.h"

@implementation Mine_AddressbookTableViewCell

- (instancetype )initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self)
    {
        [self p_setupView];
    }
    
    return self;
}

- (void )p_setupView
{
    self.image_Head = [[UIImageView alloc] init];
    self.image_Head.layer.cornerRadius = 23;
    self.image_Head.layer.masksToBounds = YES;
    [self.contentView addSubview:self.image_Head];
    
    self.name = [[UILabel alloc] init];
//    self.name.text = @"山东快书";
    self.name.textColor = [UIColor blackColor];
    self.name.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:self.name];
    
    self.department = [[UILabel alloc] init];
//    self.department.text = @"就开始就开始就几节课";
    self.department.textColor = [UIColor grayColor];
    self.department.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.department];
    
    self.image_Tel = [[UIImageView alloc] init];
    self.image_Tel.image = [UIImage imageNamed:@"Tel_blue.png"];
    self.image_Tel.layer.masksToBounds = YES;
    self.image_Tel.userInteractionEnabled = YES;
    [self.contentView addSubview:self.image_Tel];
    
    self.btn_call = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.btn_call.layer.cornerRadius = 5;
    self.btn_call.layer.borderWidth = 1.0f;
    self.btn_call.layer.borderColor = [UIColor colorWithRed:90/255.0 green:167/255.0 blue:239/255.0 alpha:1.0].CGColor;
    self.btn_call.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.btn_call];
}

- (void )layoutSubviews
{
    [super layoutSubviews];
    
    self.image_Head.frame = CGRectMake(15, 7, 46, 46);
    
    self.name.frame = CGRectMake(CGRectGetMaxX(self.image_Head.frame) + 10, 11, SCREEN_WIDTH - CGRectGetMaxX(self.image_Head.frame) - 20 - 70, 15);
    
    self.department.frame = CGRectMake(CGRectGetMaxX(self.image_Head.frame) + 10, 35, SCREEN_WIDTH - CGRectGetMaxX(self.image_Head.frame) - 20 - 70, 15);
    
    self.btn_call.frame = CGRectMake(SCREEN_WIDTH - 20 - 50, 15, 50, 30);
    
    self.image_Tel.frame = CGRectMake(SCREEN_WIDTH - 20 - 35, 20, 20, 20);
}













@end
